const getFileMd5 = (file, chunkSize, cb) => {
    return new Promise(resolve => {
        const blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice
        const md5 = new SparkMD5();
        const fr = new FileReader();
        let index = 0;
        const loadFile = () => {
            cb((index * 100) / file.size);
            const slice = blobSlice.call(file, index, index + chunkSize);
            fr.readAsBinaryString(slice);
        }
        loadFile();
        fr.onload = (e) => {
            md5.appendBinary(e.target.result);
            if (index < file.size) {
                index += chunkSize;
                loadFile()
            } else {
                resolve(md5.end())
            }
        }
    })
}